const {Schema,model} = require('mongoose');

const moment = require('moment');
//设置数据结构
const customerCommentsSchema = new Schema({
    usersID:{
        type:Schema.Types.ObjectId,//关联用户ID   
        ref:'User'
    },
    userID:{
        type:Schema.Types.ObjectId,//关联被评价人ID
        ref:'User'
    },
    score:Number,//评分
    content:String,//评价内容
    ratingTime:{
        type:String,
        default:moment().format('YYYY年MM月DD日'),//评价时间
    },
},{versionKey:false});
//设置数据集合的模型
const CustomerComments = model('CustomerComments',customerCommentsSchema,'customerComments');
module.exports.CustomerComments = CustomerComments;
